package com.biz.primus.app.customercenter;

import com.biz.primus.app.customercenter.config.Swagger2Configuration;
import com.biz.primus.ms.base.feign.PrimusSoaFeignErrorDecoder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

/**
 * @author jun.liu
 * @usage
 * @reviewer
 * @since 2017年11月15日
 */
@SpringCloudApplication
@Import({Swagger2Configuration.class})
@EnableFeignClients
public class CustomerCenterApplication extends SpringBootServletInitializer
{

	public static void main(String[] args)
	{
		SpringApplication.run(CustomerCenterApplication.class, args);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(CustomerCenterApplication.class);
	}

	@Bean
	public PrimusSoaFeignErrorDecoder getErrorDecoder()
	{
		return new PrimusSoaFeignErrorDecoder();
	}

}
